package TCP2;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.ServerSocket;
import java.net.Socket;
import java.security.DigestInputStream;

public class Server {
    public static void main(String[] args) throws IOException {

        ServerSocket ss = new ServerSocket(10011);

        //获取当前对象的输入流
        Socket socket = ss.accept();
        InputStream ios = socket.getInputStream();
        InputStreamReader isr=new InputStreamReader(ios);
        BufferedReader br=new BufferedReader(isr);

        int b;
        while ((b=br.read())!=-1)
        {
            System.out.println((char)b);
        }
        socket.close();
        ss.close();


    }
}
